
<template>
    <div>
        <el-form :model="formData" ref="form" :inline="false" size="normal">

            <el-form-item label="名称">
                <el-input size="small" v-model.trim="formData.name"></el-input>
            </el-form-item>
            <el-form-item label="父节点" v-if="formData.parentNodeCode">
                <div>
                    <span style="padding-right:5px;">{{formData.parentNodeName}}</span>
                    <span>{{formData.parentNodeCode}}</span>
                </div>
            </el-form-item>
            <el-form-item label="业务状态">
                <el-input size="small" v-model="formData.currentUserName"></el-input>
            </el-form-item>
            <el-form-item label="深度">
                <el-input size="small" type="number" v-model.trim="formData.deep"></el-input>
            </el-form-item>
            <el-form-item label="默认处理人">
                <el-input size="small" v-model="formData.currentUserName"></el-input>
            </el-form-item>
            <el-form-item label="用户查找方式">
                <el-input size="small" v-model="formData.currentUserName"></el-input>
            </el-form-item>
            <el-form-item label="合流类型">
                <el-input size="small" v-model="formData.currentUserName"></el-input>
            </el-form-item>
            <el-form-item label="部门类型">
                <!-- 1真实组织架构  5虚拟组织架构 -->
                <el-input size="small" v-model="formData.currentUserName"></el-input>
            </el-form-item>
            <el-form-item label="是否显示">
                <el-input size="small" v-model="formData.currentUserName"></el-input>
            </el-form-item>
        </el-form>

    </div>
</template>
<script>
import { fillData } from '@/utils/index.js'
export default {
    data() {
        return {
            graph: undefined,
            formData: {
                _id: "",
                name: "",
                parentNodeCode: "",
                parentNodeName: "",
                deep: "",
                currentUserName: "",
                currentUserId: "",
                // 合流类型   1非合流节点   5合流节点
                confluenceType: "",
                //合流节点ID
                confluenceId: "",
                //'默认处理部门类型  1真实组织架构  5虚拟组织架构
                departType: "",
                departId: "",
                departName: "",
                departIdPath: "",
                //业务状态
                bpmState: "",
                //管理类型 1非管理节点  5管理节点
                manageType: "",
                //显示类型 1显示   5不显示
                viewType: "",
                makeUserType: "",
                //查找类型 1默认查找   5根据流程中产生的用户类型查找
                findType: "",
                findUserType: "",
            }
        }
    },
    methods: {
        /**
        * @params 
        * @desc
        * @return 
        */
        initByDialog(_data) {
            var self = this;
            this.graph = _data && _data.graph;
            fillData(this.formData, _data)
            this.fillParentName(this.formData)
        },
        /**
        * @params 
        * @desc
        * @return 
        */
        fillParentName(data) {
            var parentNodeName = ""
            var parentNodeCode = data && data.parentNodeCode
            if (parentNodeCode) {
                var parentCell = this.graph.getCellById(parentNodeCode)
                parentNodeName = parentCell && parentCell.label
            }

            data.parentNodeName = parentNodeName


        },
        submitByDialog() {
            return { success: true, data: this.formData }
        }

    }

}
</script>